<extend name="Base/common"/>

<block name="style">
<link href="__CSS__/stylesheet.css" rel="stylesheet">
<link href="__CSS__/business.css" rel="stylesheet">
</block>

<block name="header">
<header>
	<include file="User/header" />
</header>
</block>

<block name="body">
<div class="container main">
	<div class="user-main">
		<div class="col-xs-3">
			<include file="Business/left_menu" />
		</div>
		<div class="col-xs-9">
			<h5>发布商品</h5>
			<div class="content add-success">
				<div class="center">
					<p class="success">发布商品成功</p>
					<p class="share"><span>分享到：</span><a href="javascript:;" class="icon icon-shequ">社区</a><a href="javascript:;" class="icon icon-qq">QQ</a><a href="javascript:;" class="icon icon-weixin">微信</a></p>
				</div>
			</div>
		</div>
	</div>
</div>
</block>

<block name="script">
<script type="text/javascript" src="__STATIC__/uploadify/jquery.uploadify.min.js"></script>					
<script type="text/javascript">	
var rootpath="__ROOT__";
//上传图片
/* 初始化上传插件 */
$("#headpic").uploadify({
	  "auto"          : true,
	  "height"          : 100,
      "swf"             : "__STATIC__/uploadify/uploadify.swf",
      "fileObjName"     : "download",
      "buttonText"		: "修改头像",
      "uploader"        : "{:U('File/uploadPicture',array('session_id'=>session_id()))}",
      "width"           : 100,	      
      'removeTimeout'	  :0,
      'fileTypeExts'	  : '*.jpg; *.png; *.gif;',
      "onUploadSuccess" : uploadPicture_panel,
      'onFallback' : function() {
          alert('未检测到兼容版本的Flash.');
      }
});	   
function uploadPicture_panel(file, data){
   	var data = $.parseJSON(data);
   	src = data.url || "__ROOT__" + data.path;
       if(data.status){
       	$("input[name='headpic']").val(data.id);
       	src = data.url || '__ROOT__' + data.path
       	$(".headpic").find('img').attr('src',src);
       } else {
       	updateAlert(data.info);				        	
    }
}
/* 初始化上传插件 */
$("#signpic").uploadify({
	  "auto"          : true,
	  "height"          : 40,
      "swf"             : "__STATIC__/uploadify/uploadify.swf",
      "fileObjName"     : "download",
      "buttonText"		: "上传",
     "buttonClass"		:"btn",
      "uploader"        : "{:U('File/uploadPicture',array('session_id'=>session_id()))}",
      "width"           : 150,	      
      'removeTimeout'	  :0,
      'fileTypeExts'	  : '*.jpg; *.png; *.gif;',
      "onUploadSuccess" : uploadPicture_signpic,
      'onFallback' : function() {
          alert('未检测到兼容版本的Flash.');
      }
});	   
function uploadPicture_signpic(file, data){
   	var data = $.parseJSON(data);
   	src = data.url || "__ROOT__" + data.path;
       if(data.status){
       	$("input[name='signpic']").val(data.id);
       	src = data.url || '__ROOT__' + data.path
       	$(".shop-head-img").find('img').attr('src',src);
       } else {
       	updateAlert(data.info);				        	
    }
}
highlight_leftnav("{:U('Business/index')}");
highlight_subnav("{:U('Business/index')}");
</script>
</block>